# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataflow.V1b3.Model.ApproximateSplitRequest do
  @moduledoc """
  A suggestion by the service to the worker to dynamically split the WorkItem.

  ## Attributes

  *   `fractionConsumed` (*type:* `float()`, *default:* `nil`) - A fraction at which to split the work item, from 0.0 (beginning of the input) to 1.0 (end of the input).
  *   `fractionOfRemainder` (*type:* `float()`, *default:* `nil`) - The fraction of the remainder of work to split the work item at, from 0.0 (split at the current position) to 1.0 (end of the input).
  *   `position` (*type:* `GoogleApi.Dataflow.V1b3.Model.Position.t`, *default:* `nil`) - A Position at which to split the work item.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :fractionConsumed => float() | nil,
          :fractionOfRemainder => float() | nil,
          :position => GoogleApi.Dataflow.V1b3.Model.Position.t() | nil
        }

  field(:fractionConsumed)
  field(:fractionOfRemainder)
  field(:position, as: GoogleApi.Dataflow.V1b3.Model.Position)
end

defimpl Poison.Decoder, for: GoogleApi.Dataflow.V1b3.Model.ApproximateSplitRequest do
  def decode(value, options) do
    GoogleApi.Dataflow.V1b3.Model.ApproximateSplitRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataflow.V1b3.Model.ApproximateSplitRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
